#include <iostream>
#include <cmath>
class container {
protected:
    double radius;
public:
    container(double radius) : radius(radius) {}
    virtual double surface_area() = 0;
    virtual double volume() = 0;
};
class cube : public container {
private:
    double side;
public:
    cube(double side) : container(side), side(side) {}
    double surface_area() override {
        return 6 * side * side;
    }
    double volume() override {
        return side * side * side;
    }
};
class sphere : public container {
public:
    sphere(double radius) : container(radius) {}
    double surface_area() override {
        return 4 * M_PI * radius * radius;
    }
    double volume() override {
        return (4.0 / 3) * M_PI * pow(radius, 3);
    }
};
class cylinder : public container {
private:
    double height;
public:
    cylinder(double radius, double height) : container(radius), height(height) {}
    double surface_area() override {
        return 2 * M_PI * radius * radius + 2 * M_PI * radius * height;
    }
    double volume() override {
        return M_PI * radius * radius * height;
    }
};
int main() {
    cube c(6.0);
    sphere s(5.0);
    cylinder cy(5.0, 6.0);
    std::cout << "正方体的表面积: " << c.surface_area() << "，体积: " << c.volume() << std::endl;
    std::cout << "球体的表面积: " << s.surface_area() << "，体积: " << s.volume() << std::endl;
    std::cout << "圆柱体的表面积: " << cy.surface_area() << "，体积: " << cy.volume() << std::endl;
    return 0;
}